<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
<html><head><title>Phonon Class Reference</title><style>h3.fn,span.fn { margin-left: 1cm; text-indent: -1cm }
a:link { color: #004faf; text-decoration: none }
a:visited { color: #672967; text-decoration: none }
td.postheader { font-family: sans-serif }
tr.address { font-family: sans-serif }
body { background: #ffffff; color: black; }
</style></head><body><table border="0" cellpadding="0" cellspacing="0" width="100%"><tr /><td align="left" valign="top" width="32"><img align="left" border="0" height="32" src="images/rb-logo.png" width="32" /></td><td width="1">&#160;&#160;</td><td class="postheader" valign="center"><a href="index.html"><font color="#004faf">Home</font></a>&#160;&#183; <a href="classes.html"><font color="#004faf">All Classes</font></a>&#160;&#183; <a href="modules.html"><font color="#004faf">Modules</font></a></td></table><h1 align="center">Phonon Class Reference<br /><sup><sup>[<a href="phonon.html">phonon</a> module]</sup></sup></h1><p>The Phonon namespace contains classes and functions for
multimedia applications. <a href="#details">More...</a></p>

<h3>Types</h3><ul><li><div class="fn" />class <b><a href="phonon-abstractaudiooutput.html">AbstractAudioOutput</a></b></li><li><div class="fn" />class <b><a href="phonon-abstractvideooutput.html">AbstractVideoOutput</a></b></li><li><div class="fn" />class <b><a href="phonon-audiocapturedevice.html">AudioCaptureDevice</a></b></li><li><div class="fn" />class <b><a href="phonon-audiochanneldescription.html">AudioChannelDescription</a></b></li><li><div class="fn" />class <b><a href="phonon-audiooutput.html">AudioOutput</a></b></li><li><div class="fn" />class <b><a href="phonon-audiooutputdevice.html">AudioOutputDevice</a></b></li><li><div class="fn" />class <b><a href="phonon-audiooutputdevicemodel.html">AudioOutputDeviceModel</a></b></li><li><div class="fn" />class <b><a href="phonon-backendcapabilities.html">BackendCapabilities</a></b></li><li><div class="fn" />enum <b><a href="phonon.html#Category-enum">Category</a></b> { NoCategory, NotificationCategory, MusicCategory, VideoCategory, ..., AccessibilityCategory }</li><li><div class="fn" />enum <b><a href="phonon.html#DiscType-enum">DiscType</a></b> { NoDisc, Cd, Dvd, Vcd }</li><li><div class="fn" />class <b><a href="phonon-effect.html">Effect</a></b></li><li><div class="fn" />class <b><a href="phonon-effectdescription.html">EffectDescription</a></b></li><li><div class="fn" />class <b><a href="phonon-effectdescriptionmodel.html">EffectDescriptionModel</a></b></li><li><div class="fn" />class <b><a href="phonon-effectparameter.html">EffectParameter</a></b></li><li><div class="fn" />class <b><a href="phonon-effectwidget.html">EffectWidget</a></b></li><li><div class="fn" />enum <b><a href="phonon.html#ErrorType-enum">ErrorType</a></b> { NoError, NormalError, FatalError }</li><li><div class="fn" />class <b><a href="phonon-mediacontroller.html">MediaController</a></b></li><li><div class="fn" />class <b><a href="phonon-medianode.html">MediaNode</a></b></li><li><div class="fn" />class <b><a href="phonon-mediaobject.html">MediaObject</a></b></li><li><div class="fn" />class <b><a href="phonon-mediasource.html">MediaSource</a></b></li><li><div class="fn" />enum <b><a href="phonon.html#MetaData-enum">MetaData</a></b> { ArtistMetaData, AlbumMetaData, TitleMetaData, DateMetaData, ..., MusicBrainzDiscIdMetaData }</li><li><div class="fn" />class <b><a href="phonon-path.html">Path</a></b></li><li><div class="fn" />class <b><a href="phonon-seekslider.html">SeekSlider</a></b></li><li><div class="fn" />enum <b><a href="phonon.html#State-enum">State</a></b> { LoadingState, StoppedState, PlayingState, BufferingState, PausedState, ErrorState }</li><li><div class="fn" />class <b><a href="phonon-subtitledescription.html">SubtitleDescription</a></b></li><li><div class="fn" />class <b><a href="phonon-videoplayer.html">VideoPlayer</a></b></li><li><div class="fn" />class <b><a href="phonon-videowidget.html">VideoWidget</a></b></li><li><div class="fn" />class <b><a href="phonon-volumeslider.html">VolumeSlider</a></b></li></ul><h3>Static Methods</h3><ul><li><div class="fn" />QString <b><a href="phonon.html#categoryToString">categoryToString</a></b> (Category&#160;<i>c</i>)</li><li><div class="fn" />Path <b><a href="phonon.html#createPath">createPath</a></b> (MediaNode&#160;<i>source</i>, MediaNode&#160;<i>sink</i>)</li><li><div class="fn" />MediaObject <b><a href="phonon.html#createPlayer">createPlayer</a></b> (Category&#160;<i>category</i>, MediaSource&#160;<i>source</i>&#160;=&#160;Phonon.MediaSource())</li><li><div class="fn" />str <b><a href="phonon.html#phononVersion">phononVersion</a></b> ()</li></ul><a name="details" /><hr /><h2>Detailed Description</h2><p>The Phonon namespace contains classes and functions for
multimedia applications.</p>
<p>This namespace contains classes to access multimedia functions
for audio and video playback. Those classes are not dependent on
any specific framework, but rather use exchangeable backends to do
the work.</p>
<p>See the <a href="phonon-module.html">Phonon Module</a> page for
general information about the framework and the <a href="phonon-overview.html#phonon-overview">Phonon Overview</a> for an
introductory tour of its features.</p>
<hr /><h2>Type Documentation</h2><h3 class="fn"><a name="Category-enum" />Phonon.Category</h3><p>Sets the category your program should be listed in in the
mixer.</p>
<table class="valuelist">
<tr class="odd" valign="top">
<th class="tblConst">Constant</th>
<th class="tblval">Value</th>
<th class="tbldscr">Description</th>
</tr>
<tr>
<td class="topAlign"><tt>Phonon.NoCategory</tt></td>
<td class="topAlign"><tt>-1</tt></td>
<td class="topAlign">Will make use of the default device.</td>
</tr>
<tr>
<td class="topAlign"><tt>Phonon.NotificationCategory</tt></td>
<td class="topAlign"><tt>0</tt></td>
<td class="topAlign">If the sounds produced are notifications
(ping, beep and such) you should use this category.</td>
</tr>
<tr>
<td class="topAlign"><tt>Phonon.MusicCategory</tt></td>
<td class="topAlign"><tt>1</tt></td>
<td class="topAlign">If your application is a music player (like a
jukebox or media player playing an audio file).</td>
</tr>
<tr>
<td class="topAlign"><tt>Phonon.VideoCategory</tt></td>
<td class="topAlign"><tt>2</tt></td>
<td class="topAlign">If the sound is the audio channel of a
video.</td>
</tr>
<tr>
<td class="topAlign"><tt>Phonon.CommunicationCategory</tt></td>
<td class="topAlign"><tt>3</tt></td>
<td class="topAlign">If your applications produces sounds from
communication with somebody else (VoIP, voice chat).</td>
</tr>
<tr>
<td class="topAlign"><tt>Phonon.GameCategory</tt></td>
<td class="topAlign"><tt>4</tt></td>
<td class="topAlign">Sound produced by a computer game should go
into this category.</td>
</tr>
<tr>
<td class="topAlign"><tt>Phonon.AccessibilityCategory</tt></td>
<td class="topAlign"><tt>5</tt></td>
<td class="topAlign">Sounds produced for accessibility (e.g.,
Text-To-Speech) Holds the largest value of categories.</td>
</tr>
</table>
<p>A Jukebox will set this to Music, a VoIP program to
Communication, a DVD player to video, and so on.</p>
<p><b>Note:</b> These categories can also become useful for an
application that controls the volumes automatically, like turning
down the music when a call comes in, or turning down the
notifications when the media player knows it's playing classical
music.</p>


<h3 class="fn"><a name="DiscType-enum" />Phonon.DiscType</h3><p>Enum to identify the media discs supported by <a href="phonon-mediaobject.html">MediaObject</a>.</p>
<table class="valuelist">
<tr class="odd" valign="top">
<th class="tblConst">Constant</th>
<th class="tblval">Value</th>
<th class="tbldscr">Description</th>
</tr>
<tr>
<td class="topAlign"><tt>Phonon.NoDisc</tt></td>
<td class="topAlign"><tt>-1</tt></td>
<td class="topAlign">No disc was selected. This is only useful as a
return value from MediaSource.diskType().</td>
</tr>
<tr>
<td class="topAlign"><tt>Phonon.Cd</tt></td>
<td class="topAlign"><tt>0</tt></td>
<td class="topAlign">Identifies Audio CDs.</td>
</tr>
<tr>
<td class="topAlign"><tt>Phonon.Dvd</tt></td>
<td class="topAlign"><tt>1</tt></td>
<td class="topAlign">Identifies DVDs (not arbitrary data DVDs, only
movie DVDs).</td>
</tr>
<tr>
<td class="topAlign"><tt>Phonon.Vcd</tt></td>
<td class="topAlign"><tt>2</tt></td>
<td class="topAlign">Identifies Video CDs.</td>
</tr>
</table>
<p><b>See also</b> <a href="phonon-mediasource.html">MediaSource</a> and <a href="phonon-mediaobject.html">MediaObject</a>.</p>


<h3 class="fn"><a name="ErrorType-enum" />Phonon.ErrorType</h3><p>This enum describes the severity when an error has occurred
during playback.</p>
<p>After a media object has entered the <a href="phonon.html#State-enum">ErrorState</a>, one can query the type of
error from <a href="phonon-mediaobject.html#errorType">MediaObject.errorType()</a>.
Note that you should query the error when receiving the <a href="phonon-mediaobject.html#stateChanged">MediaObject.stateChanged()</a>
signal, because the error type will be lost if the media object
leaves the error state.</p>
<table class="valuelist">
<tr class="odd" valign="top">
<th class="tblConst">Constant</th>
<th class="tblval">Value</th>
<th class="tbldscr">Description</th>
</tr>
<tr>
<td class="topAlign"><tt>Phonon.NoError</tt></td>
<td class="topAlign"><tt>0</tt></td>
<td class="topAlign">No error. <a href="phonon-mediaobject.html#errorType">MediaObject.errorType</a>()
returns this if <a href="phonon-mediaobject.html#state">MediaObject.state</a>() !=
<a href="phonon.html#State-enum">Phonon.ErrorState</a>.</td>
</tr>
<tr>
<td class="topAlign"><tt>Phonon.NormalError</tt></td>
<td class="topAlign"><tt>1</tt></td>
<td class="topAlign">An error has occurred with the playback of the
current source. It might be possible to continue playback, for
instance, if only the audio stream in a video cannot be played
back. The media object will then leave the error state again.</td>
</tr>
<tr>
<td class="topAlign"><tt>Phonon.FatalError</tt></td>
<td class="topAlign"><tt>2</tt></td>
<td class="topAlign">. Something important does not work. Your
program cannot continue the playback of the current source, but it
might be possible to try another.</td>
</tr>
</table>
<p><b>See also</b> <a href="phonon-mediaobject.html#errorType">MediaObject.errorType</a>().</p>


<h3 class="fn"><a name="MetaData-enum" />Phonon.MetaData</h3><p>Provided as keys for <a href="phonon-mediaobject.html#metaData">Phonon.MediaObject.metaData</a>().
The enum values matches strings defined in the Ogg Vorbis
specification</p>
<table class="valuelist">
<tr>
<th class="tblConst">Constant</th>
<th class="tblVal">Value</th>
</tr>
<tr>
<td class="topAlign"><tt>Phonon.ArtistMetaData</tt></td>
<td class="topAlign"><tt>0</tt></td>
</tr>
<tr>
<td class="topAlign"><tt>Phonon.AlbumMetaData</tt></td>
<td class="topAlign"><tt>1</tt></td>
</tr>
<tr>
<td class="topAlign"><tt>Phonon.TitleMetaData</tt></td>
<td class="topAlign"><tt>2</tt></td>
</tr>
<tr>
<td class="topAlign"><tt>Phonon.DateMetaData</tt></td>
<td class="topAlign"><tt>3</tt></td>
</tr>
<tr>
<td class="topAlign"><tt>Phonon.GenreMetaData</tt></td>
<td class="topAlign"><tt>4</tt></td>
</tr>
<tr>
<td class="topAlign"><tt>Phonon.TracknumberMetaData</tt></td>
<td class="topAlign"><tt>5</tt></td>
</tr>
<tr>
<td class="topAlign"><tt>Phonon.DescriptionMetaData</tt></td>
<td class="topAlign"><tt>6</tt></td>
</tr>
<tr>
<td class="topAlign">
<tt>Phonon.MusicBrainzDiscIdMetaData</tt></td>
<td class="topAlign"><tt>7</tt></td>
</tr>
</table>


<h3 class="fn"><a name="State-enum" />Phonon.State</h3><p>The state enum describes the different states a media object can
take. Several functions of <a href="phonon-mediaobject.html">MediaObject</a> are asynchronous, so even
if a you have requested a state change through a function call,
e.g., through <a href="phonon-mediaobject.html#play">play()</a>,
you cannot be sure that the change has taken place before you
receive the <a href="phonon-mediaobject.html#stateChanged">stateChanged()</a>
signal.</p>
<p>A media object can at any time change into any state, regardless
of the state it previously had.</p>
<table class="valuelist">
<tr class="odd" valign="top">
<th class="tblConst">Constant</th>
<th class="tblval">Value</th>
<th class="tbldscr">Description</th>
</tr>
<tr>
<td class="topAlign"><tt>Phonon.LoadingState</tt></td>
<td class="topAlign"><tt>0</tt></td>
<td class="topAlign">After construction it might take a while
before the media object is ready to <a href="phonon-mediaobject.html#play">play()</a>. This state is commonly
used by backends to initialize the <a href="phonon-overview.html#phonon-overview">media graph</a> and loading
the source. When the object leaves the loading state, it will enter
the StoppedState unless an error occurred or another state is
requested through a function call, e.g., <a href="phonon-mediaobject.html#play">MediaObject.play()</a>.</td>
</tr>
<tr>
<td class="topAlign"><tt>Phonon.StoppedState</tt></td>
<td class="topAlign"><tt>1</tt></td>
<td class="topAlign">In the stopped state, the media object is
ready to play its current media source. The current <a href="phonon-mediaobject.html#seek">position</a> in the media stream is
then 0.</td>
</tr>
<tr>
<td class="topAlign"><tt>Phonon.PlayingState</tt></td>
<td class="topAlign"><tt>2</tt></td>
<td class="topAlign">The media object is playing back its media
source.</td>
</tr>
<tr>
<td class="topAlign"><tt>Phonon.BufferingState</tt></td>
<td class="topAlign"><tt>3</tt></td>
<td class="topAlign">The Player is waiting for data to be able to
start or continue playing. This state is commonly used to wait for
media data over a network connection.</td>
</tr>
<tr>
<td class="topAlign"><tt>Phonon.PausedState</tt></td>
<td class="topAlign"><tt>4</tt></td>
<td class="topAlign">The media player has currently paused its
playback, i.e., it stops playing but keeps the current playback
position in the stream.</td>
</tr>
<tr>
<td class="topAlign"><tt>Phonon.ErrorState</tt></td>
<td class="topAlign"><tt>5</tt></td>
<td class="topAlign">When a media object enters the error state a
problem with the playback has occurred. The possible errors are
grouped into two categories by <a href="phonon.html#ErrorType-enum">Phonon.ErrorType</a>, and the type
can be queried through <a href="phonon-mediaobject.html#errorType">errorType()</a>. A <a href="phonon.html#ErrorType-enum">FatalError</a> implies that the
playback cannot continue, but one can still try with a new media
source. With a <a href="phonon.html#ErrorType-enum">NormalError</a>
it might be possible to continue playback, and a media object may
therefore change state from the ErrorState.</td>
</tr>
</table>
<p>This enum was introduced or modified in Qt 4.4.</p>
<p><b>See also</b> <a href="phonon-mediaobject.html">MediaObject</a>.</p>


<hr /><h2>Method Documentation</h2><h3 class="fn"><a name="categoryToString" />QString Phonon.categoryToString (<a href="phonon.html#Category-enum">Category</a>&#160;<i>c</i>)</h3><p>Returns a (translated) string to show to the user identifying
the given Category (<i>c</i>).</p>


<h3 class="fn"><a name="createPath" /><a href="phonon-path.html">Path</a> Phonon.createPath (<a href="phonon-medianode.html">MediaNode</a>&#160;<i>source</i>, <a href="phonon-medianode.html">MediaNode</a>&#160;<i>sink</i>)</h3><p>Creates a new Path connecting the two MediaNodes <i>source</i>
and <i>sink</i>.</p>
<p>The implementation will automatically select the right format
and media type. E.g. connecting a <a href="phonon-mediaobject.html">MediaObject</a> and <a href="phonon-audiooutput.html">AudioOutput</a> will create a Path object
connecting the audio. This might be represented as PCM or perhaps
even AC3 depending on the <a href="phonon-audiooutput.html">AudioOutput</a> object.</p>
<p><i>source</i> The <a href="phonon-medianode.html">MediaNode</a>
to connect an output from <i>sink</i> The <a href="phonon-medianode.html">MediaNode</a> to connect to.</p>


<h3 class="fn"><a name="createPlayer" /><a href="phonon-mediaobject.html">MediaObject</a> Phonon.createPlayer (<a href="phonon.html#Category-enum">Category</a>&#160;<i>category</i>, <a href="phonon-mediasource.html">MediaSource</a>&#160;<i>source</i>&#160;=&#160;Phonon.MediaSource())</h3><p>Convenience function to create a <a href="phonon-mediaobject.html">MediaObject</a> and <a href="phonon-audiooutput.html">AudioOutput</a> connected by a path. The
<a href="phonon-mediaobject.html">MediaObject</a> return will have
<i>source</i> set as its current source and the specified
<i>category</i>.</p>


<h3 class="fn"><a name="phononVersion" />str Phonon.phononVersion ()</h3><p>Returns the Phonon version.</p>
<p>This function was introduced in Qt 4.5.</p>
<address><hr /><div align="center"><table border="0" cellspacing="0" width="100%"><tr class="address"><td align="left" width="25%">PyQt&#160;4.9.1 for X11</td><td align="center" width="50%">Copyright &#169; <a href="http://www.riverbankcomputing.com">Riverbank&#160;Computing&#160;Ltd</a> and <a href="http://www.qtsoftware.com">Nokia</a> 2011</td><td align="right" width="25%">Qt&#160;4.8.0</td></tr></table></div></address></body></html>